package com.hunt.controller;

import com.hunt.model.dto.*;
import com.hunt.service.UserCountService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;

/**
 * @Author Tong
 * @Date 2020/7/3/10:15
 * @Description
 */
@Api(value = "用户统计模块")
@Controller
@RequestMapping("userCount")
public class UserCountController extends BaseController {
    private static final Logger log = LoggerFactory.getLogger(UserCountController.class);
    @Autowired
    private UserCountService userCountService;

    @ApiOperation(value = "跳转至用户统计模块", httpMethod = "GET", produces = "text/html")
//    @RequiresPermissions("user:list")
    @RequestMapping(value = "userCount", method = RequestMethod.GET)
    public String user() {
        return "system/userCount";
    }


    //用户统计
    @ApiOperation(value = "三类用户数量与在线数量统计", httpMethod = "GET", produces = "application/json", response = PageInfo.class)
    @ResponseBody
    @RequestMapping(value = "getCount", method = RequestMethod.GET)
    public List<UserCount> getCount() {
        return userCountService.getCount();
    }


}
